//
//  ZYXNavThreeViewController.m
//  OCUIAdvanced
//
//  导航控制器的 3 子控制器
//


#import "ZYXNavThreeViewController.h"

@interface ZYXNavThreeViewController ()

- (IBAction)backTwo;
- (IBAction)backOne;

@end

@implementation ZYXNavThreeViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.navigationItem.title = @"第3个控制器";
    
    
    UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:nil action:nil];
    
    UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil];
    
    self.navigationItem.rightBarButtonItems = @[item1, item2];
}

- (IBAction)backTwo {
    // 移除栈顶控制器即可
    [self.navigationController popViewControllerAnimated:YES];
    
    //[self.navigationController popToViewController:two animated:YES];
}

- (IBAction)backOne {
    [self.navigationController popToRootViewControllerAnimated:YES];
    
    //self.navigationController popToViewController:one animated:YES];
}

@end
